package com.mitcub.panda.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mitcub.panda.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @项目名称: Oceanic
 * @类名称: Order
 * @类描述: 订单实体
 * @作者: tangloong
 * @创建时间: 2021/11/12 9:42
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fa_order")
public class Order extends BaseEntity {

    //雪花算法 主键ID
    //避免 由于JS最大16位 这里19位造成数字精度丢失问题 转成String
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    private Long  uid;
    private Integer  payStatus;
    private Integer  goodsId;
    private String   price;
    private String   orderAmount;
    private String   moneyPaid;
    private String   payAmount;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTime;
    private Integer sort;
    private Integer status;

}
